#!/user/bin/python
#coding = utf-8
import sys
import itertools
import numpy as np
k = 3
for line in sys.stdin:
    words = line.strip('\n').split(' ')
    words = np.unique(words)
    words.sort()
    com = list(itertools.combinations(words,k))
    for line in com:
        re = '('+line[0]
        i=1
        while i < k:
            re = re + ',' +line[i] 
            i+=1
        re=re+')'
        print(re+'\t'+'1')
    
